package com.ljx.reflect.reflect03;

/**
 * @author LJX
 * @Description: TODO
 * @Date: 2022/10/27 9:39
 * @Version 1.0
 */
public class Test {
	public static void main(String[] args) throws Exception{
		// 通过全路径获取class对象
		Class<?> aClass = Class.forName("com.ljx.reflect.reflect03.People");

		// 通过对象直接获取反射类对象
		People people = new People();
		Class<? extends People> aClass1 = people.getClass();
		// 通过类名来获取反射类对象
		Class<People> peopleClass = People.class;

		System.out.println(peopleClass==aClass);
		System.out.println(aClass==aClass1);
		System.out.println(peopleClass==aClass1);



	}
}


class People{
	private String name;
	public int age;
	public static void ljx(){
		System.out.println("ljx方法");
	}
}